<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>菜单</title>
<link href="../../Include/Default.css" rel="stylesheet" type="text/css" />
<script src="../../Framework/Main.js"></script>
<script>
Page.onLoad(function(){
	var id = Args["DataGridID"];
	var arr = Parent.$(id).getColumnInfo();
	var html = [];
	html.push("<table width='100%'>");
	for(var i=0;i<arr.length;i++){
		if(i%4==0){
			html.push("<tr>");
		}
		html.push("<td height='25' width='25%'><input type='checkbox' columnWidth='"+arr[i][2]+"' columnName='"+arr[i][0]+"' name='Column' checked id='Column"+i+"' value='"+arr[i][1]+"'>");
		html.push("<lable for='Column"+i+"'>"+arr[i][0]+"</label></td>\n");
		if(i%4==3){
			html.push("</tr>");
		}
	}
	if(arr.length%4!=0){
		html.push("</tr>");
	}
	html.push("</table>");
	$("tdNames").innerHTML = html.join('');
});

function onAllClick(){
	var arr = $N('Column');
	for(var i=0;i<arr.length;i++){
		arr[i].checked = $('all').checked;
	}
}
</script>
</head>
<body>
<table width="90%" height="100%" border="0" align="center">
  <tr>
    <td height="40"><fieldset>
        <legend>
        <input type="checkbox" name="all" id="all" checked onClick="onAllClick()">
        <label for="all"><strong>全部列</strong></label>
        </legend>
        <div id="tdNames">&nbsp;</div>
      </fieldset></td>
  </tr>
</table>
</body>
</html>
